package com.cosina.game.crystallight.model.profile;

import com.cosina.game.crystallight.engine.BattleStatistics;

public class Stats {
	public int[] data;
	public Stats(int[] data){
		this.data = data;
	}
	
	public static final int CAMPAIGN_SCORE = 0;
	public static final int BATTLE_SCORE = 1;
	public static final int GAMES_PLAYED = 2;
	public static final int ENEIMES_KILLED = 3;
	public static final int CRYSTALS_CREATED = 4;
	public static final int MINES_CREATED = 5;
	public static final int TOWERS_BUILT = 6;
	public int get(int type){
		return data[type];
	}
	
	public int add(int type,int addValue){
		return data[type] = data[type] + addValue;
	}
	
	
	public void proposalStatistics(BattleStatistics bs){
		add(CAMPAIGN_SCORE,bs.campaignScore);
		add(BATTLE_SCORE,bs.battleScore);
		add(GAMES_PLAYED,1);
		add(ENEIMES_KILLED,bs.enemyKilled);
		add(CRYSTALS_CREATED,bs.crystalCreated);
		add(MINES_CREATED,bs.getMinesCreated());
		add(TOWERS_BUILT,bs.towerBuilt);
	}
}
